package main

import (
	"gitee.com/jinmingzhi/kit/app"
	"gitee.com/jinmingzhi/kit/rest"
	"gitee.com/jinmingzhi/kit/rpc"
)

func main() {
	log.Info("init handler")
	Initglobal()
	log.Info("init rpc")
	rpcServer := rpc.NewServerWithConfig()
	RegisterGRPC(rpcServer.Server)
	rpcServer.MustListenAndServe()

	log.Info("init rest")
	restServer := rest.NewServerWithConfig()
	MustRegisterREST(restServer.ServeMux, rpcServer.Address)
	ServerSwaggerUi(restServer.HttpServeMux)
	restServer.ListenAndServed()

	app.Exit()
}
